package org.martyn.danbodroid.gui;

import android.content.Context;
import android.widget.TextView;

public class PreferenceRowSingle extends PreferenceRow
{
	private String key;

	public PreferenceRowSingle(Context context, String key)
	{
		super(context);

		this.addView(inflate(context, android.R.layout.simple_list_item_1, null));

		this.key = key;
	}

	public PreferenceRowSingle(Context context, String key, int titleResourceId)
	{
		super(context);

		this.addView(inflate(context, android.R.layout.simple_list_item_1, null));

		this.key = key;

		setTitle(titleResourceId);
	}

	public void setTitle(int titleResourceId)
	{
		((TextView) findViewById(android.R.id.text1)).setText(titleResourceId);
	}

	public void setTitle(String title)
	{
		((TextView) findViewById(android.R.id.text1)).setText(title);
	}

	public String getKey()
	{
		return key;
	}
}
